#include <iostream>
#include <string>
using namespace std;
class Teacher
{
public:
	int age;
	string name;
};
class Student
{
public:
	int age;
	Teacher teacher;
	Teacher GetTeacher1()
	{
		Teacher st ;
		st.age = 40;
		st.name = "t1";
		return st;
	}
	Teacher GetTeacher2()
	{
		Teacher* st= new Teacher();
		st->age = 41;
		st->name = "t2";
		return *st;
	}
};

void Test05()
{
	Student st;
	Teacher t1 = st.GetTeacher1();
	void *t1Ptr = &t1;
	Teacher* teacherPtr = static_cast<Teacher*>(t1Ptr);
	std::cout << teacherPtr->age << endl;
	std::cout << teacherPtr->name << endl;
}
void Test06()
{
	Student st;
	Teacher t2 = st.GetTeacher2();
	void* t2Ptr = &t2;
	Teacher* teacherPtr = static_cast<Teacher*>(t2Ptr);
	std::cout << teacherPtr->age << endl;
	std::cout << teacherPtr->name << endl;
}
void Test07()
{
	void* st= new Student();
	std::cout << typeid(st).raw_name() << endl;
	string sd = (string)typeid(st).raw_name();
	std::cout << sd.find("Student")<< endl;

}
void* SetTeacher()
{
	Teacher* teacher = new Teacher();
	teacher->age = 40;
	teacher->name = "wang";
	return teacher;
}
//dsda
void Test03()
{
	void* teacher = SetTeacher();
	Teacher* teacherPtr = static_cast<Teacher*>(teacher);
	cout << teacherPtr->age<<endl;
	cout << teacherPtr->name << endl;
}

void* SetTeacher2()
{
	Teacher teacher ;
	teacher.age = 40;
	teacher.name = "wang";
	return &teacher;
}
void Test04()
{
	void* teacher = SetTeacher2();
	Teacher* teacherPtr = static_cast<Teacher*>(teacher);
	cout << teacherPtr->age << endl;
	cout << teacherPtr->name << endl;
}